package xna.android;


import br.com.R;
import android.content.res.Resources;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;

public class Controller {
	private Button[] buttons = new Button[4];
	
	public Controller(Resources resources)
	{
		
		buttons[0] = new Button(BitmapFactory.decodeResource(resources, R.drawable.ic_launcher),new Vector2(100,320),null,"up");
		buttons[1] = new Button(BitmapFactory.decodeResource(resources, R.drawable.ic_launcher),new Vector2(100,400),null,"down");
		buttons[2] = new Button(BitmapFactory.decodeResource(resources, R.drawable.ic_launcher),new Vector2(140,350),null,"right");
		buttons[3] = new Button(BitmapFactory.decodeResource(resources, R.drawable.ic_launcher),new Vector2(65,350),null,"left");
		
	}
	public Button[] getButtons()
	{
		return buttons;
	}
	public Button getButton(String name)
	{
		for (Button b : buttons)
			if (b.getName() == name)
				return b;
		return null;
	}
	public void draw(Canvas canvas)
	{
		for (Button b : buttons)
		{
			b.draw(canvas);
		}
	}

}
